{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9b309c07-8f38-4053-afcc-1c4d82b233a1",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-04-19T07:23:49.066973Z",
     "start_time": "2022-04-19T07:23:45.858650Z"
    }
   },
   "outputs": [],
   "source": [
    "from tensorflow import keras\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "7964683a-89ce-4482-b35f-8cffbbef67a5",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-04-19T07:23:57.427032Z",
     "start_time": "2022-04-19T07:23:56.589533Z"
    }
   },
   "outputs": [],
   "source": [
    "# 一个神经元，形状一维\n",
    "model = keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])]) \n",
    "# 优化策略optimizer 随机梯度下降sgd   loss损失函数（又叫目标函数）为均方误差\n",
    "model.compile(optimizer='sgd', loss='mean_squared_error') "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "991c9bb0-c357-4993-af9f-c2388a5f55b3",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-04-19T07:24:00.111512Z",
     "start_time": "2022-04-19T07:24:00.095581Z"
    }
   },
   "outputs": [],
   "source": [
    "# 组织数据  y = f(x) = 2*x -1\n",
    "xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0], dtype=float)\n",
    "ys = np.array([-3.0, -1.0, 1.0, 3.0, 5.0, 7.0], dtype=float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "0b9d8179-4bbf-4f3a-bf45-ac99df327b40",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-04-19T07:24:04.667597Z",
     "start_time": "2022-04-19T07:24:02.030760Z"
    },
    "collapsed": true,
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 23.6133\n",
      "Epoch 2/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 18.8617\n",
      "Epoch 3/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 15.1174\n",
      "Epoch 4/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 12.1660\n",
      "Epoch 5/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 9.8383\n",
      "Epoch 6/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 8.0015\n",
      "Epoch 7/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 6.5511\n",
      "Epoch 8/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 5.4047\n",
      "Epoch 9/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 4.4976\n",
      "Epoch 10/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 3.7789\n",
      "Epoch 11/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 3.2085\n",
      "Epoch 12/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.7549\n",
      "Epoch 13/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 2.3934\n",
      "Epoch 14/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 2.1042\n",
      "Epoch 15/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 1.8722\n",
      "Epoch 16/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.6852\n",
      "Epoch 17/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 1.5338\n",
      "Epoch 18/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.4103\n",
      "Epoch 19/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.3090\n",
      "Epoch 20/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 1.2252\n",
      "Epoch 21/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.1553\n",
      "Epoch 22/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 1.0963\n",
      "Epoch 23/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.0461\n",
      "Epoch 24/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.0028\n",
      "Epoch 25/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.9651\n",
      "Epoch 26/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.9317\n",
      "Epoch 27/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.9020\n",
      "Epoch 28/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.8751\n",
      "Epoch 29/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.8506\n",
      "Epoch 30/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.8279\n",
      "Epoch 31/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.8068\n",
      "Epoch 32/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.7871\n",
      "Epoch 33/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 0.7684\n",
      "Epoch 34/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.7506\n",
      "Epoch 35/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.7336\n",
      "Epoch 36/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.7174\n",
      "Epoch 37/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.7017\n",
      "Epoch 38/500\n",
      "1/1 [==============================] - 0s 987us/step - loss: 0.6865\n",
      "Epoch 39/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.6718\n",
      "Epoch 40/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.6575\n",
      "Epoch 41/500\n",
      "1/1 [==============================] - 0s 995us/step - loss: 0.6436\n",
      "Epoch 42/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 0.6301\n",
      "Epoch 43/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.6170\n",
      "Epoch 44/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.6041\n",
      "Epoch 45/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.5916\n",
      "Epoch 46/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.5793\n",
      "Epoch 47/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.5673\n",
      "Epoch 48/500\n",
      "1/1 [==============================] - 0s 968us/step - loss: 0.5556\n",
      "Epoch 49/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.5441\n",
      "Epoch 50/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.5329\n",
      "Epoch 51/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.5219\n",
      "Epoch 52/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.5112\n",
      "Epoch 53/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.5006\n",
      "Epoch 54/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.4903\n",
      "Epoch 55/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.4803\n",
      "Epoch 56/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.4704\n",
      "Epoch 57/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.4607\n",
      "Epoch 58/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.4512\n",
      "Epoch 59/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.4420\n",
      "Epoch 60/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.4329\n",
      "Epoch 61/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.4240\n",
      "Epoch 62/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.4153\n",
      "Epoch 63/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.4068\n",
      "Epoch 64/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.3984\n",
      "Epoch 65/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.3902\n",
      "Epoch 66/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.3822\n",
      "Epoch 67/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.3743\n",
      "Epoch 68/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.3667\n",
      "Epoch 69/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.3591\n",
      "Epoch 70/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.3517\n",
      "Epoch 71/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.3445\n",
      "Epoch 72/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.3374\n",
      "Epoch 73/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.3305\n",
      "Epoch 74/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.3237\n",
      "Epoch 75/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.3171\n",
      "Epoch 76/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.3106\n",
      "Epoch 77/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.3042\n",
      "Epoch 78/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.2979\n",
      "Epoch 79/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.2918\n",
      "Epoch 80/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.2858\n",
      "Epoch 81/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.2800\n",
      "Epoch 82/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.2742\n",
      "Epoch 83/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.2686\n",
      "Epoch 84/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.2631\n",
      "Epoch 85/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.2576\n",
      "Epoch 86/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.2524\n",
      "Epoch 87/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.2472\n",
      "Epoch 88/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.2421\n",
      "Epoch 89/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.2371\n",
      "Epoch 90/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.2323\n",
      "Epoch 91/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.2275\n",
      "Epoch 92/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.2228\n",
      "Epoch 93/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.2182\n",
      "Epoch 94/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.2137\n",
      "Epoch 95/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.2094\n",
      "Epoch 96/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.2051\n",
      "Epoch 97/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.2008\n",
      "Epoch 98/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.1967\n",
      "Epoch 99/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.1927\n",
      "Epoch 100/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1887\n",
      "Epoch 101/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1848\n",
      "Epoch 102/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1810\n",
      "Epoch 103/500\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1/1 [==============================] - 0s 998us/step - loss: 0.1773\n",
      "Epoch 104/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.1737\n",
      "Epoch 105/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.1701\n",
      "Epoch 106/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.1666\n",
      "Epoch 107/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1632\n",
      "Epoch 108/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1599\n",
      "Epoch 109/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1566\n",
      "Epoch 110/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1534\n",
      "Epoch 111/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1502\n",
      "Epoch 112/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1471\n",
      "Epoch 113/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1441\n",
      "Epoch 114/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1411\n",
      "Epoch 115/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1382\n",
      "Epoch 116/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1354\n",
      "Epoch 117/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1326\n",
      "Epoch 118/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1299\n",
      "Epoch 119/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1272\n",
      "Epoch 120/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1246\n",
      "Epoch 121/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.1221\n",
      "Epoch 122/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1195\n",
      "Epoch 123/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1171\n",
      "Epoch 124/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1147\n",
      "Epoch 125/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1123\n",
      "Epoch 126/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.1100\n",
      "Epoch 127/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.1078\n",
      "Epoch 128/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1055\n",
      "Epoch 129/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1034\n",
      "Epoch 130/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.1013\n",
      "Epoch 131/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0992\n",
      "Epoch 132/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0971\n",
      "Epoch 133/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0951\n",
      "Epoch 134/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0932\n",
      "Epoch 135/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0913\n",
      "Epoch 136/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0894\n",
      "Epoch 137/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0876\n",
      "Epoch 138/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0858\n",
      "Epoch 139/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0840\n",
      "Epoch 140/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0823\n",
      "Epoch 141/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0806\n",
      "Epoch 142/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0789\n",
      "Epoch 143/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0773\n",
      "Epoch 144/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0757\n",
      "Epoch 145/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0742\n",
      "Epoch 146/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0726\n",
      "Epoch 147/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0712\n",
      "Epoch 148/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0697\n",
      "Epoch 149/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0683\n",
      "Epoch 150/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0669\n",
      "Epoch 151/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0655\n",
      "Epoch 152/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0641\n",
      "Epoch 153/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0628\n",
      "Epoch 154/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0615\n",
      "Epoch 155/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0603\n",
      "Epoch 156/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0590\n",
      "Epoch 157/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0578\n",
      "Epoch 158/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0566\n",
      "Epoch 159/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0555\n",
      "Epoch 160/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0543\n",
      "Epoch 161/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0532\n",
      "Epoch 162/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0521\n",
      "Epoch 163/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0510\n",
      "Epoch 164/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0500\n",
      "Epoch 165/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0490\n",
      "Epoch 166/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0480\n",
      "Epoch 167/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0470\n",
      "Epoch 168/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0460\n",
      "Epoch 169/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0451\n",
      "Epoch 170/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0441\n",
      "Epoch 171/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0432\n",
      "Epoch 172/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0423\n",
      "Epoch 173/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0415\n",
      "Epoch 174/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0406\n",
      "Epoch 175/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0398\n",
      "Epoch 176/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0390\n",
      "Epoch 177/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0382\n",
      "Epoch 178/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0374\n",
      "Epoch 179/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0366\n",
      "Epoch 180/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0359\n",
      "Epoch 181/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0351\n",
      "Epoch 182/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0344\n",
      "Epoch 183/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0337\n",
      "Epoch 184/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0330\n",
      "Epoch 185/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0323\n",
      "Epoch 186/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0317\n",
      "Epoch 187/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0310\n",
      "Epoch 188/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0304\n",
      "Epoch 189/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0298\n",
      "Epoch 190/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0291\n",
      "Epoch 191/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.0285\n",
      "Epoch 192/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0280\n",
      "Epoch 193/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.0274\n",
      "Epoch 194/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0268\n",
      "Epoch 195/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0263\n",
      "Epoch 196/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0257\n",
      "Epoch 197/500\n",
      "1/1 [==============================] - 0s 3ms/step - loss: 0.0252\n",
      "Epoch 198/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0247\n",
      "Epoch 199/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0242\n",
      "Epoch 200/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0237\n",
      "Epoch 201/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0232\n",
      "Epoch 202/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0227\n",
      "Epoch 203/500\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1/1 [==============================] - 0s 0s/step - loss: 0.0223\n",
      "Epoch 204/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0218\n",
      "Epoch 205/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0214\n",
      "Epoch 206/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0209\n",
      "Epoch 207/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0205\n",
      "Epoch 208/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0201\n",
      "Epoch 209/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0196\n",
      "Epoch 210/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0192\n",
      "Epoch 211/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0189\n",
      "Epoch 212/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0185\n",
      "Epoch 213/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0181\n",
      "Epoch 214/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.0177\n",
      "Epoch 215/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0173\n",
      "Epoch 216/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0170\n",
      "Epoch 217/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0166\n",
      "Epoch 218/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0163\n",
      "Epoch 219/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0160\n",
      "Epoch 220/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0156\n",
      "Epoch 221/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0153\n",
      "Epoch 222/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0150\n",
      "Epoch 223/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0147\n",
      "Epoch 224/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0144\n",
      "Epoch 225/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.0141\n",
      "Epoch 226/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0138\n",
      "Epoch 227/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0135\n",
      "Epoch 228/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0132\n",
      "Epoch 229/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0130\n",
      "Epoch 230/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0127\n",
      "Epoch 231/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0124\n",
      "Epoch 232/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0122\n",
      "Epoch 233/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0119\n",
      "Epoch 234/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0117\n",
      "Epoch 235/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0115\n",
      "Epoch 236/500\n",
      "1/1 [==============================] - 0s 995us/step - loss: 0.0112\n",
      "Epoch 237/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0110\n",
      "Epoch 238/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0108\n",
      "Epoch 239/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0105\n",
      "Epoch 240/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0103\n",
      "Epoch 241/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0101\n",
      "Epoch 242/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0099\n",
      "Epoch 243/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0097\n",
      "Epoch 244/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0095\n",
      "Epoch 245/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0093\n",
      "Epoch 246/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0091\n",
      "Epoch 247/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0089\n",
      "Epoch 248/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0087\n",
      "Epoch 249/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0086\n",
      "Epoch 250/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0084\n",
      "Epoch 251/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0082\n",
      "Epoch 252/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0080\n",
      "Epoch 253/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0079\n",
      "Epoch 254/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0077\n",
      "Epoch 255/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0076\n",
      "Epoch 256/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0074\n",
      "Epoch 257/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0073\n",
      "Epoch 258/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0071\n",
      "Epoch 259/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0070\n",
      "Epoch 260/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0068\n",
      "Epoch 261/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0067\n",
      "Epoch 262/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0065\n",
      "Epoch 263/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0064\n",
      "Epoch 264/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0063\n",
      "Epoch 265/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0061\n",
      "Epoch 266/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0060\n",
      "Epoch 267/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0059\n",
      "Epoch 268/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0058\n",
      "Epoch 269/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0057\n",
      "Epoch 270/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.0055\n",
      "Epoch 271/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0054\n",
      "Epoch 272/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0053\n",
      "Epoch 273/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0052\n",
      "Epoch 274/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0051\n",
      "Epoch 275/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0050\n",
      "Epoch 276/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0049\n",
      "Epoch 277/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0048\n",
      "Epoch 278/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0047\n",
      "Epoch 279/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0046\n",
      "Epoch 280/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0045\n",
      "Epoch 281/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0044\n",
      "Epoch 282/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0043\n",
      "Epoch 283/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0042\n",
      "Epoch 284/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0041\n",
      "Epoch 285/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0041\n",
      "Epoch 286/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0040\n",
      "Epoch 287/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0039\n",
      "Epoch 288/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0038\n",
      "Epoch 289/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0037\n",
      "Epoch 290/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0037\n",
      "Epoch 291/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 0.0036\n",
      "Epoch 292/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0035\n",
      "Epoch 293/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0034\n",
      "Epoch 294/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0034\n",
      "Epoch 295/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0033\n",
      "Epoch 296/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0032\n",
      "Epoch 297/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0032\n",
      "Epoch 298/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0031\n",
      "Epoch 299/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0030\n",
      "Epoch 300/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0030\n",
      "Epoch 301/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0029\n",
      "Epoch 302/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0029\n",
      "Epoch 303/500\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1/1 [==============================] - 0s 996us/step - loss: 0.0028\n",
      "Epoch 304/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0027\n",
      "Epoch 305/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0027\n",
      "Epoch 306/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0026\n",
      "Epoch 307/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0026\n",
      "Epoch 308/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0025\n",
      "Epoch 309/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0025\n",
      "Epoch 310/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0024\n",
      "Epoch 311/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0024\n",
      "Epoch 312/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0023\n",
      "Epoch 313/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0023\n",
      "Epoch 314/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0022\n",
      "Epoch 315/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0022\n",
      "Epoch 316/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0021\n",
      "Epoch 317/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0021\n",
      "Epoch 318/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0020\n",
      "Epoch 319/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0020\n",
      "Epoch 320/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0020\n",
      "Epoch 321/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0019\n",
      "Epoch 322/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0019\n",
      "Epoch 323/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0018\n",
      "Epoch 324/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0018\n",
      "Epoch 325/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0018\n",
      "Epoch 326/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0017\n",
      "Epoch 327/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0017\n",
      "Epoch 328/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0017\n",
      "Epoch 329/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0016\n",
      "Epoch 330/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0016\n",
      "Epoch 331/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0016\n",
      "Epoch 332/500\n",
      "1/1 [==============================] - 0s 1ms/step - loss: 0.0015\n",
      "Epoch 333/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0015\n",
      "Epoch 334/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0015\n",
      "Epoch 335/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0014\n",
      "Epoch 336/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0014\n",
      "Epoch 337/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.0014\n",
      "Epoch 338/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0014\n",
      "Epoch 339/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0013\n",
      "Epoch 340/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0013\n",
      "Epoch 341/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0013\n",
      "Epoch 342/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0012\n",
      "Epoch 343/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0012\n",
      "Epoch 344/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0012\n",
      "Epoch 345/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0012\n",
      "Epoch 346/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0011\n",
      "Epoch 347/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 0.0011\n",
      "Epoch 348/500\n",
      "1/1 [==============================] - 0s 995us/step - loss: 0.0011\n",
      "Epoch 349/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0011\n",
      "Epoch 350/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 0.0011\n",
      "Epoch 351/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 0.0010\n",
      "Epoch 352/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 0.0010\n",
      "Epoch 353/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 9.8945e-04\n",
      "Epoch 354/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 9.6913e-04\n",
      "Epoch 355/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 9.4922e-04\n",
      "Epoch 356/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 9.2972e-04\n",
      "Epoch 357/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 9.1062e-04\n",
      "Epoch 358/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 8.9192e-04\n",
      "Epoch 359/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 8.7360e-04\n",
      "Epoch 360/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 8.5566e-04\n",
      "Epoch 361/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 8.3808e-04\n",
      "Epoch 362/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 8.2087e-04\n",
      "Epoch 363/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 8.0401e-04\n",
      "Epoch 364/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 7.8749e-04\n",
      "Epoch 365/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 7.7132e-04\n",
      "Epoch 366/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 7.5547e-04\n",
      "Epoch 367/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 7.3996e-04\n",
      "Epoch 368/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 7.2476e-04\n",
      "Epoch 369/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 7.0987e-04\n",
      "Epoch 370/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 6.9529e-04\n",
      "Epoch 371/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.8100e-04\n",
      "Epoch 372/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.6702e-04\n",
      "Epoch 373/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 6.5331e-04\n",
      "Epoch 374/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.3990e-04\n",
      "Epoch 375/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.2675e-04\n",
      "Epoch 376/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 6.1388e-04\n",
      "Epoch 377/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 6.0127e-04\n",
      "Epoch 378/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 5.8892e-04\n",
      "Epoch 379/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 5.7682e-04\n",
      "Epoch 380/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 5.6497e-04\n",
      "Epoch 381/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 5.5337e-04\n",
      "Epoch 382/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 5.4200e-04\n",
      "Epoch 383/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 5.3087e-04\n",
      "Epoch 384/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 5.1996e-04\n",
      "Epoch 385/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 5.0928e-04\n",
      "Epoch 386/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 4.9882e-04\n",
      "Epoch 387/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 4.8858e-04\n",
      "Epoch 388/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 4.7854e-04\n",
      "Epoch 389/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 4.6871e-04\n",
      "Epoch 390/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 4.5909e-04\n",
      "Epoch 391/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 4.4965e-04\n",
      "Epoch 392/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 4.4042e-04\n",
      "Epoch 393/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 4.3137e-04\n",
      "Epoch 394/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 4.2251e-04\n",
      "Epoch 395/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 4.1384e-04\n",
      "Epoch 396/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 4.0534e-04\n",
      "Epoch 397/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 3.9701e-04\n",
      "Epoch 398/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 3.8885e-04\n",
      "Epoch 399/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 3.8087e-04\n",
      "Epoch 400/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 3.7304e-04\n",
      "Epoch 401/500\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1/1 [==============================] - 0s 997us/step - loss: 3.6538e-04\n",
      "Epoch 402/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 3.5787e-04\n",
      "Epoch 403/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 3.5052e-04\n",
      "Epoch 404/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 3.4332e-04\n",
      "Epoch 405/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 3.3627e-04\n",
      "Epoch 406/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 3.2936e-04\n",
      "Epoch 407/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 3.2260e-04\n",
      "Epoch 408/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 3.1597e-04\n",
      "Epoch 409/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 3.0948e-04\n",
      "Epoch 410/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 3.0313e-04\n",
      "Epoch 411/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 2.9690e-04\n",
      "Epoch 412/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 2.9080e-04\n",
      "Epoch 413/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 2.8483e-04\n",
      "Epoch 414/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.7898e-04\n",
      "Epoch 415/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.7325e-04\n",
      "Epoch 416/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 2.6763e-04\n",
      "Epoch 417/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 2.6214e-04\n",
      "Epoch 418/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 2.5675e-04\n",
      "Epoch 419/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 2.5148e-04\n",
      "Epoch 420/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.4631e-04\n",
      "Epoch 421/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.4125e-04\n",
      "Epoch 422/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 2.3630e-04\n",
      "Epoch 423/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 2.3144e-04\n",
      "Epoch 424/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.2669e-04\n",
      "Epoch 425/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.2203e-04\n",
      "Epoch 426/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 2.1747e-04\n",
      "Epoch 427/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.1301e-04\n",
      "Epoch 428/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 2.0863e-04\n",
      "Epoch 429/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 2.0434e-04\n",
      "Epoch 430/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 2.0015e-04\n",
      "Epoch 431/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.9604e-04\n",
      "Epoch 432/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.9201e-04\n",
      "Epoch 433/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 1.8806e-04\n",
      "Epoch 434/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.8420e-04\n",
      "Epoch 435/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 1.8042e-04\n",
      "Epoch 436/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.7671e-04\n",
      "Epoch 437/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.7308e-04\n",
      "Epoch 438/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.6953e-04\n",
      "Epoch 439/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.6605e-04\n",
      "Epoch 440/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.6264e-04\n",
      "Epoch 441/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 1.5929e-04\n",
      "Epoch 442/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.5602e-04\n",
      "Epoch 443/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.5282e-04\n",
      "Epoch 444/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.4968e-04\n",
      "Epoch 445/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.4661e-04\n",
      "Epoch 446/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.4359e-04\n",
      "Epoch 447/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.4064e-04\n",
      "Epoch 448/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.3776e-04\n",
      "Epoch 449/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 1.3493e-04\n",
      "Epoch 450/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.3215e-04\n",
      "Epoch 451/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.2944e-04\n",
      "Epoch 452/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.2678e-04\n",
      "Epoch 453/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.2418e-04\n",
      "Epoch 454/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.2163e-04\n",
      "Epoch 455/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.1913e-04\n",
      "Epoch 456/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.1668e-04\n",
      "Epoch 457/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.1429e-04\n",
      "Epoch 458/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.1194e-04\n",
      "Epoch 459/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.0964e-04\n",
      "Epoch 460/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.0739e-04\n",
      "Epoch 461/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 1.0518e-04\n",
      "Epoch 462/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 1.0302e-04\n",
      "Epoch 463/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 1.0090e-04\n",
      "Epoch 464/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 9.8830e-05\n",
      "Epoch 465/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 9.6800e-05\n",
      "Epoch 466/500\n",
      "1/1 [==============================] - 0s 996us/step - loss: 9.4812e-05\n",
      "Epoch 467/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 9.2864e-05\n",
      "Epoch 468/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 9.0956e-05\n",
      "Epoch 469/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 8.9089e-05\n",
      "Epoch 470/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 8.7259e-05\n",
      "Epoch 471/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 8.5466e-05\n",
      "Epoch 472/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 8.3711e-05\n",
      "Epoch 473/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 8.1992e-05\n",
      "Epoch 474/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 8.0307e-05\n",
      "Epoch 475/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 7.8658e-05\n",
      "Epoch 476/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 7.7041e-05\n",
      "Epoch 477/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 7.5459e-05\n",
      "Epoch 478/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 7.3908e-05\n",
      "Epoch 479/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 7.2391e-05\n",
      "Epoch 480/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 7.0905e-05\n",
      "Epoch 481/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.9448e-05\n",
      "Epoch 482/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.8022e-05\n",
      "Epoch 483/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.6624e-05\n",
      "Epoch 484/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 6.5256e-05\n",
      "Epoch 485/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.3915e-05\n",
      "Epoch 486/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.2603e-05\n",
      "Epoch 487/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 6.1318e-05\n",
      "Epoch 488/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 6.0057e-05\n",
      "Epoch 489/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 5.8823e-05\n",
      "Epoch 490/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 5.7614e-05\n",
      "Epoch 491/500\n",
      "1/1 [==============================] - 0s 2ms/step - loss: 5.6431e-05\n",
      "Epoch 492/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 5.5271e-05\n",
      "Epoch 493/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 5.4136e-05\n",
      "Epoch 494/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 5.3024e-05\n",
      "Epoch 495/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 5.1935e-05\n",
      "Epoch 496/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 5.0868e-05\n",
      "Epoch 497/500\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1/1 [==============================] - 0s 998us/step - loss: 4.9823e-05\n",
      "Epoch 498/500\n",
      "1/1 [==============================] - 0s 998us/step - loss: 4.8800e-05\n",
      "Epoch 499/500\n",
      "1/1 [==============================] - 0s 997us/step - loss: 4.7798e-05\n",
      "Epoch 500/500\n",
      "1/1 [==============================] - 0s 0s/step - loss: 4.6816e-05\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras.callbacks.History at 0x1dbaefb3d90>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 模型学习拟合数据  \n",
    "model.fit(xs, ys,epochs=500) # epochs迭代次数为500 # 如下观察到loss逐渐减小"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "9f3794da-9892-4652-85b0-a9acfe49944f",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-04-19T07:24:12.658914Z",
     "start_time": "2022-04-19T07:24:12.608065Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[18.980038]], dtype=float32)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 学习完成进行预测  y = f(x) = 2*10-1 = 19 也就是结果应该是接近19\n",
    "model.predict([10.0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a5a83c6b-29bf-4d92-be86-7a86c6b06aca",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {
    "height": "93.9946px",
    "width": "217.255px"
   },
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": "12",
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
